package com.eclipse.e0112_io.bz案例;

import java.io.FileInputStream;

public class b读取字符_字节数 {

	static int count = 0;

	public static void main(String[] args) throws Exception {

		FileInputStream fis = new FileInputStream("/Users/liuzhuangzhuang/Desktop/test1.txt");

		int result = 0;
		byte[] content = new byte[38];

//		do {
//			result = fis.read(content);
//			System.out.println(new String(content, "utf-8"));
//		} while (result != -1);
		
		if(result != -1) {
			result = fis.read(content);
			System.out.println(new String(content, "utf-8"));
		}

		fis.close();
		fis = new FileInputStream("/Users/liuzhuangzhuang/Desktop/test1.txt");
		while (fis.read() != -1) {
			System.out.println(++count);
		}

		fis.close();

	}

}
